<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<LINK href="showAllOrg.files/style.htm" rel=stylesheet>
		<LINK href="showAllOrg.files/content.htm" rel=stylesheet>
		
 		<script type="text/javascript">
		    var djConfig = {
				isDebug:true,
				parseOnLoad:true,
				usePlainJson:true
		    };
		</script>
		 
		<script type="text/javascript" src="dojo/dojo/dojo.js"></script>
		<script type="text/javascript" src="dojo/dijit/dijit.js"></script>

		<script type="text/javascript">
    		dojo.require("dijit.form.Button");
    		dojo.require("dojo.rpc.JsonService");    	
    	</script>
    	<script language="JavaScript" type="text/javascript">
    		var orderBoxService = new dojo.rpc.JsonService("box/order/OrderBoxService?smd");
    		var orderPlanImportService = new dojo.rpc.JsonService("box/alloc/OrderPlanImportService?smd");
			var makeShipperNoteService = new dojo.rpc.JsonService("box/order/MakeShipperNoteService?smd");
			var declareService = new dojo.rpc.JsonService("DeclareService?smd");
			
    		//页面加载时的一些操作
			dojo.addOnLoad(load);
			function load() {
				initPage();
			}
			function initPage() {
				makeShipperNoteService.getOrderPlan().addCallback(function (orderPlan) {
					makeShipperNoteService.getAllocDetails().addCallback(function (ad) {
						makeShipperNoteService.getShipperNote().addCallback(function (sn) {
							declareService.getDeclareComitByCommId(ad.commission.id).addCallback(function (dc) {
								console.dir(dc);
								console.dir(ad);
								document.getElementById("sn_id1").value = sn.id + "号委托报关明细";
								document.getElementById("date").innerHTML = showDate();
								document.getElementById("dcId").innerHTML = dc.id;
								document.getElementById("blId").innerHTML = dc.BLInfo.id;
								
								document.getElementById("shipname").innerHTML = orderPlan.shipSchedule.shipInfo.name;
								document.getElementById("shipcom").innerHTML = orderPlan.shipSchedule.shipInfo.shipComInfo.shortTitle;
								document.getElementById("scd_id").innerHTML = orderPlan.shipSchedule.id;
								document.getElementById("sender_name").innerHTML = ad.commission.sender.name;
								document.getElementById("load_port").innerHTML = ad.commission.departure;
								document.getElementById("destination1").innerHTML = ad.commission.destination;
								document.getElementById("destination2").innerHTML = ad.commission.destination;
								makeShipperNoteService.getBoxAndGoods(sn.id).addCallback(function (BAG) {
									console.dir(BAG);
									var bag = BAG.list;
									var tbl = document.getElementById("box_and_goods");
									
									var boxNum = 0;
									for (var i in bag) {
										var text = "";
										console.dir(bag[i]);
										
										if (bag[i].box.declare == false) {
											text = text + "<td width='70' align='center'><a href='javascript:make_declare_form(" + bag[i].id + ")'><img src='showAllOrg.files/cus.gif' border='0'/></a></td>";
										} else {
											text = text + "<td width='70' align='center'><a href='javascript:show_declare_form(" + bag[i].id + ")'><img src='showAllOrg.files/view.gif' border='0'/></a></td>";
										}
										text = text + "<td width='70' align='center'>" + bag[i].box.id + "</td>";
										text = text + "<td width='70' align='center'>" + bag[i].box.type  + "</td>";
										text = text + "<td width='70' align='center'>" + bag[i].goods.type  + "</td>";
										text = text + "<td width='70' align='center'>" + bag[i].goodsNum  + "</td>";
										text = text + "<td width='70' align='center'>" + bag[i].goods.weight*bag[i].goodsNum  + "</td>";
										text = text + "<td width='70' align='center'>" + bag[i].goods.size*bag[i].goodsNum  + "</td>";
										text = text + "<td width='70' align='center'>无</td>";

										var tr = document.createElement("tr");
										tr.className = "gridtreven";
										tbl.appendChild(tr);
										tr.innerHTML = text;
										
										boxNum = boxNum + 1;
									}
									
									document.getElementById("boxNum").innerHTML = boxNum;		
									document.getElementById("cy").innerHTML = BAG.list[0].box.CYInfo.name;
								});
								document.getElementById("goodsType").innerHTML = ad.commission.goods.type;
							});
						});
					});
				});
			}
			//得到当前日期
			function showDate() {
				var today = new Date();   
				var day = today.getDate();   
				var month = today.getMonth() + 1;   
				var year = today.getFullYear();   
				return year + "-" + month + "-" + day;
			}
			//制报关单
			function make_declare_form(bagId) {
				orderBoxService.setBagId(bagId).addCallback(function () {
					window.open("报关单明细.htm", "_self");
				});
			}
			//报关单明细
			function show_declare_form(bagId) {
				orderBoxService.setBagId(bagId).addCallback(function () {
					window.open("显示装箱单明细.htm", "_self");
				});
			}
			//查看报关委托书
			function show_declare_comit() {
				makeShipperNoteService.getAllocDetails().addCallback(function (ad) {
					declareService.setCommId(ad.commission.id).addCallback(function () {
						window.open("打印报关委托书明细.htm", "_self");
					});
				});
			}
    	</script>

<title>报关单</title>

</head>

<body>

<font face="隶书" color="3656B9" ; style="font-size: 18px;">报关单</font><br>
<img src="showAllOrg.files/line2.gif"><br>

<center>


	<table width="700" border="0" cellpadding="0" cellspacing="0" >		
     	 <tr height="80">
       <td class="ctitle" ><input id="sn_id1" class ="billtitle" value="10022号委托报关明细" size=40></td>
      </tr>
	</table>

	<table width="760" border="0" cellpadding="0" cellspacing="0" >
   
	</table>

	<table  class="titlearea" width="760" border="0" cellpadding="2" cellspacing="1">
      <tr >
			 <td		class="rtitle" width=95>*运输日期：</td>
			
          <td id="date" 	class="ltitle">2008-01-02         
          </td> 
          <td		class="rtitle" width=95>*报关委托编号：</td>
          <td  id="dcId"	class="ltitle">10022         
          </td>
		  <td		class="rtitle" width=95>*提单号：</td>
          <td id="blId" 	class="ltitle">1003311         
          </td>
      </tr >
		   <tr>
		   <td		class="rtitle" width=95>发货人：</td>
          <td  id="sender_name"	class="ltitle">威海出口公司         
          </td>
		   <td		class="rtitle" width=95>代理：</td>
          <td  	class="ltitle">哈工大货代        
          </td>
		  <td		class="rtitle" width=95>海关：</td>
          <td  	class="ltitle"><input type="text" name="Bill_desc"
          value="威海海关" 	  size=10 class="linput" >         
          </td>
		  </tr>

             <tr >
			 <td		class="rtitle" width=95>船公司名：</td>
			
          <td id="shipcom" 	class="ltitle">华东海运         
          </td> 
          <td		class="rtitle" width=95>船名：</td>
          <td id="shipname" 	class="ltitle">华东明珠2号         
          </td>
		  <td		class="rtitle" width=95>船次：</td>
          <td  id="scd_id"	class="ltitle">1342         
          </td>
		   </tr >
		   
		   <tr >
			 <td		class="rtitle" width=95>装货港：</td>
			
          <td  id="load_port"	class="ltitle">SHIDAO,CHINA</td> 
          <td		class="rtitle" width=95>目的港：</td>
          <td  id="destination1"	class="ltitle">INCHON,KOREA         
          </td>
		  <td		class="rtitle" width=95>卸货港：</td>
          <td  id="destination2"	class="ltitle">INCHON,KOREA         
          </td>
		   </tr >
		   <tr >
			 <td		class="rtitle" width=95>集装箱数：</td>
			
          <td id="boxNum" 	class="ltitle">5         
          </td> 
          <td		class="rtitle" width=95>货物种类：</td>
          <td id="goodsType" 	class="ltitle">普通         
          </td>
		  <td		class="rtitle" width=95>装箱场站名称：</td>
          <td id="cy" 	class="ltitle">威海场站</td>
		   </tr >
		 
  
	  <tr>
          <td class="rtitle">审批状态：</td>
          <td class="ltitle">  
          
			未提交</td>
          <td class="rtitle">审批流程：</td><td class="ltitle" colspan="3">        
          <input name="Check_flow_id"   type="hidden" value="StoreStart001" size="10" class="linputrl">
          <input name="Check_flow_name" type="text"   value="缮制" size="20" class="linputr">
          <input name="Audit_state_flag" type="hidden" value="S" size="10" class="linputrl">
          </td>
      </tr>
	  
	</table>

<table width="760">
    <tr>
      <td class="rtitle">
	   
	    
      <font face="Webdings" class="redcolor">4</font><a href="javascript:myClose()">关闭</a>
      
      
      <font face="Webdings" class="redcolor">4</font><a href="#" onclick="java:window.history.go(-1)">返回</a>
      
	  </td>
	</tr>
</table>

<table width=760>
<tr>
<td align="left">
 <a href="#"><font  id="ctrInfFont0" color="blue" >子报关单列表</font></a>
</td>
</tr>
</table>

          <table id="box_and_goods" width="760" align="center" cellpadding="2" cellspacing="1" class=gridarea>
            <tr>
                                    <td width="70" class="gridtitletd" align="center">操作 </td>									
									<td width="70" class="gridtitletd" align="center">集装箱号 </td>
									<td width="70" class="gridtitletd" align="center">箱型</td>
									<td width="70" class="gridtitletd" align="center">货物名称</td>
									<td width="70" class="gridtitletd" align="center">件数与包装</td>
									<td width="70" class="gridtitletd" align="center">毛重</td>
									<td width="70" class="gridtitletd" align="center">尺寸</td>
									<td width="70" class="gridtitletd" align="center">备注</td>
								 </tr>
          </table>
           

  <table width="760">
    <tr>
      <td class="ltitle" width="90%">
      	
      	
    		<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' height='30'>
<tr>
 <td width='100%' align='left'> <a href='javascript: firstPage_2()'><img src='images/first.gif' width='20' border='0' height='15'></a><a href='javascript: prevPage_2()'><img src='images/first1.gif' width='20' border='0' height='15'></a> <input class='linput' size='3' value='1' onKeyPress='return locate_2(this);'> 
 <a href='javascript: nextPage_2()'><img src='images/last1.gif' width='20' border='0' height='15'></a><a href='javascript: lastPage_2()'><img src='images/last.gif' width='20' border='0' height='15'></a>&nbsp;
 第1页/共1页
 </td>
</tr>
</table>


      </td>
    </tr>
  </table>

</center>

</body>
</html>


